<?php

	/**
	 * Workspace@ Engine application comment!
	 * 
	 * LICENSE
	 * This application is licensed under New BSD license.
	 * Please read complete LICENSE.txt inside of root folder for more details.
	 * 
	 * We wish you good building :) 
	 * 
	 * @category   Application
	 * @package    Bootstrap
	 * @author     Nevio Vesic <nevio@workspaceat.com>
	 * @copyright  2008-2009 Workspace@ group in association with Design strategist
	 */

	class Engine_Repository_Menu extends Engine_Application
	{
		/**
		 * Backend directory under repository root dir
		 */
		const BACKEND_DIR = "Backend/";
		
		/**
		 * Frontend directory under repository root dir
		 */
		const FRONTEND_DIR = "Frontend/";
		
		/**
		 * Package directory!
		 *
		 */
		const PACKAGE_BASE = "Menu/";
		
		/**
		 * Package filename extension
		 *
		 */
		const PACKAGE_EXTENSION = ".phtml";
		
		
		public function loadRequiredCss( $com, $type )
		{
				
		}
		
		public function loadRequiredJs( $com, $type )
		{
				
		}
		
		public function loadComponent( $com, $type )
		{
			$file = self::BACKEND_DIR . self::PACKAGE_BASE . strtolower( $com ) . self::PACKAGE_EXTENSION;
			
			if (! @fopen ( $file, "r", true ) )
			{
				throw new Engine_Exception( "Current package '{$com}' can't be resolved under desired repository! Fatal error!" );
			}
			
			require_once $file;
		}
		
	}

